#pragma once

#include <iostream>
#include <string>
#include <functional>


using namespace std;

using callback_t = function<void(int,string,uint16_t)>;


class Task
{
public:
    Task():servicefd_(-1),clientport_(-1)
    {

    }
    Task(int servicefd,string clientip,uint16_t clientport,callback_t func)
    :servicefd_(servicefd),clientip_(clientip),clientport_(clientport),func_(func)
    {

    }
    void operator() ()
    {
        func_(servicefd_,clientip_,clientport_);
    }
private:
    int servicefd_;
    uint16_t clientport_;
    string clientip_;
    callback_t func_;
};
